using Machine.Specifications;
using Unbound.Tests.Unbinding.TestObjects;

namespace Unbound.Tests.Unbinding.Specifications.NullMembers
{
	[Subject("Unbinding")]
	public class unbinding_null_members : unbinding<ComplexType>
	{
		Establish context = () =>
		                    	{
		                    		Request = new ComplexType
		                    		          	{
		                    		          		Number = 42,
		                    		          		Text = null
		                    		          	};
		                    		Prefix = "";
		                    	};

		It should_bind_the_existing_property = () => ((ComplexType) Bound).Number.ShouldEqual(42);

		It should_also_bind_the_null_property_to_null_of_course =
			() => ((ComplexType)Bound).Text.ShouldBeNull();
	}
}